package com.wz.project.cxtj.viewOutHistory.service.impl;

import com.wz.common.utils.text.Convert;
import com.wz.project.cxtj.viewOutHistory.domain.ViewOutHistory;
import com.wz.project.cxtj.viewOutHistory.mapper.ViewOutHistoryMapper;
import com.wz.project.cxtj.viewOutHistory.service.IViewOutHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 出库单据历史Service业务层处理
 * 
 * @author wz
 * @date 2022-05-18
 */
@Service
public class ViewOutHistoryServiceImpl implements IViewOutHistoryService 
{
    @Autowired
    private ViewOutHistoryMapper viewOutHistoryMapper;

    /**
     * 查询出库单据历史
     * 
     * @param stockoutDetailId 出库单据历史ID
     * @return 出库单据历史
     */
    @Override
    public ViewOutHistory selectViewOutHistoryById(String stockoutDetailId)
    {
        return viewOutHistoryMapper.selectViewOutHistoryById(stockoutDetailId);
    }

    /**
     * 查询出库单据历史列表
     * 
     * @param viewOutHistory 出库单据历史
     * @return 出库单据历史
     */
    @Override
    public List<ViewOutHistory> selectViewOutHistoryList(ViewOutHistory viewOutHistory)
    {
        return viewOutHistoryMapper.selectViewOutHistoryList(viewOutHistory);
    }

    /**
     * 新增出库单据历史
     * 
     * @param viewOutHistory 出库单据历史
     * @return 结果
     */
    @Override
    public int insertViewOutHistory(ViewOutHistory viewOutHistory)
    {
        return viewOutHistoryMapper.insertViewOutHistory(viewOutHistory);
    }

    /**
     * 修改出库单据历史
     * 
     * @param viewOutHistory 出库单据历史
     * @return 结果
     */
    @Override
    public int updateViewOutHistory(ViewOutHistory viewOutHistory)
    {
        return viewOutHistoryMapper.updateViewOutHistory(viewOutHistory);
    }

    /**
     * 删除出库单据历史对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteViewOutHistoryByIds(String ids)
    {
        return viewOutHistoryMapper.deleteViewOutHistoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除出库单据历史信息
     * 
     * @param stockoutDetailId 出库单据历史ID
     * @return 结果
     */
    @Override
    public int deleteViewOutHistoryById(String stockoutDetailId)
    {
        return viewOutHistoryMapper.deleteViewOutHistoryById(stockoutDetailId);
    }
}
